﻿///////////////////////////////////////////////////////////////
// This is generated code. 
//////////////////////////////////////////////////////////////
// Code is generated using LLBLGen Pro version: 3.1
// Code is generated on: 2012年10月10日 8:11:47
// Code is generated using templates: SD.TemplateBindings.SharedTemplates.NET20
// Templates vendor: Solutions Design.
// Templates version: 
//////////////////////////////////////////////////////////////
using System;
using System.Collections;
using System.Collections.Generic;
using NetDon.eBoss.Data;
using NetDon.eBoss.Data.FactoryClasses;
using NetDon.eBoss.Data.HelperClasses;
using SD.LLBLGen.Pro.ORMSupportClasses;

namespace NetDon.eBoss.Data.RelationClasses
{
	/// <summary>Implements the relations factory for the entity: Productcategory. </summary>
	public partial class ProductcategoryRelations
	{
		/// <summary>CTor</summary>
		public ProductcategoryRelations()
		{
		}

		/// <summary>Gets all relations of the ProductcategoryEntity as a list of IEntityRelation objects.</summary>
		/// <returns>a list of IEntityRelation objects</returns>
		public virtual List<IEntityRelation> GetAllRelations()
		{
			List<IEntityRelation> toReturn = new List<IEntityRelation>();
			toReturn.Add(this.ProduccategoryattributeEntityUsingProdcateid);
			toReturn.Add(this.ProductEntityUsingProdcategory);
			toReturn.Add(this.ProductcategoryEntityUsingProdcategoryid);
			toReturn.Add(this.ProductcategoryEntityUsingProdcateidProdcategoryid);
			return toReturn;
		}

		#region Class Property Declarations

		/// <summary>Returns a new IEntityRelation object, between ProductcategoryEntity and ProduccategoryattributeEntity over the 1:n relation they have, using the relation between the fields:
		/// Productcategory.Prodcateid - Produccategoryattribute.Prodcateid
		/// </summary>
		public virtual IEntityRelation ProduccategoryattributeEntityUsingProdcateid
		{
			get
			{
				IEntityRelation relation = new EntityRelation(SD.LLBLGen.Pro.ORMSupportClasses.RelationType.OneToMany, "Produccategoryattribute" , true);
				relation.AddEntityFieldPair(ProductcategoryFields.Prodcateid, ProduccategoryattributeFields.Prodcateid);
				relation.InheritanceInfoPkSideEntity = InheritanceInfoProviderSingleton.GetInstance().GetInheritanceInfo("ProductcategoryEntity", true);
				relation.InheritanceInfoFkSideEntity = InheritanceInfoProviderSingleton.GetInstance().GetInheritanceInfo("ProduccategoryattributeEntity", false);
				return relation;
			}
		}

		/// <summary>Returns a new IEntityRelation object, between ProductcategoryEntity and ProductEntity over the 1:n relation they have, using the relation between the fields:
		/// Productcategory.Prodcateid - Product.Prodcategory
		/// </summary>
		public virtual IEntityRelation ProductEntityUsingProdcategory
		{
			get
			{
				IEntityRelation relation = new EntityRelation(SD.LLBLGen.Pro.ORMSupportClasses.RelationType.OneToMany, "Product" , true);
				relation.AddEntityFieldPair(ProductcategoryFields.Prodcateid, ProductFields.Prodcategory);
				relation.InheritanceInfoPkSideEntity = InheritanceInfoProviderSingleton.GetInstance().GetInheritanceInfo("ProductcategoryEntity", true);
				relation.InheritanceInfoFkSideEntity = InheritanceInfoProviderSingleton.GetInstance().GetInheritanceInfo("ProductEntity", false);
				return relation;
			}
		}

		/// <summary>Returns a new IEntityRelation object, between ProductcategoryEntity and ProductcategoryEntity over the 1:n relation they have, using the relation between the fields:
		/// Productcategory.Prodcateid - Productcategory.Prodcategoryid
		/// </summary>
		public virtual IEntityRelation ProductcategoryEntityUsingProdcategoryid
		{
			get
			{
				IEntityRelation relation = new EntityRelation(SD.LLBLGen.Pro.ORMSupportClasses.RelationType.OneToMany, "Productcategory_" , true);
				relation.AddEntityFieldPair(ProductcategoryFields.Prodcateid, ProductcategoryFields.Prodcategoryid);
				relation.InheritanceInfoPkSideEntity = InheritanceInfoProviderSingleton.GetInstance().GetInheritanceInfo("ProductcategoryEntity", true);
				relation.InheritanceInfoFkSideEntity = InheritanceInfoProviderSingleton.GetInstance().GetInheritanceInfo("ProductcategoryEntity", false);
				return relation;
			}
		}


		/// <summary>Returns a new IEntityRelation object, between ProductcategoryEntity and ProductcategoryEntity over the m:1 relation they have, using the relation between the fields:
		/// Productcategory.Prodcategoryid - Productcategory.Prodcateid
		/// </summary>
		public virtual IEntityRelation ProductcategoryEntityUsingProdcateidProdcategoryid
		{
			get
			{
				IEntityRelation relation = new EntityRelation(SD.LLBLGen.Pro.ORMSupportClasses.RelationType.ManyToOne, "Productcategory", false);
				relation.AddEntityFieldPair(ProductcategoryFields.Prodcateid, ProductcategoryFields.Prodcategoryid);
				relation.InheritanceInfoPkSideEntity = InheritanceInfoProviderSingleton.GetInstance().GetInheritanceInfo("ProductcategoryEntity", false);
				relation.InheritanceInfoFkSideEntity = InheritanceInfoProviderSingleton.GetInstance().GetInheritanceInfo("ProductcategoryEntity", true);
				return relation;
			}
		}
		/// <summary>stub, not used in this entity, only for TargetPerEntity entities.</summary>
		public virtual IEntityRelation GetSubTypeRelation(string subTypeEntityName) { return null; }
		/// <summary>stub, not used in this entity, only for TargetPerEntity entities.</summary>
		public virtual IEntityRelation GetSuperTypeRelation() { return null;}
		#endregion

		#region Included Code

		#endregion
	}
	
	/// <summary>Static class which is used for providing relationship instances which are re-used internally for syncing</summary>
	internal static class StaticProductcategoryRelations
	{
		internal static readonly IEntityRelation ProduccategoryattributeEntityUsingProdcateidStatic = new ProductcategoryRelations().ProduccategoryattributeEntityUsingProdcateid;
		internal static readonly IEntityRelation ProductEntityUsingProdcategoryStatic = new ProductcategoryRelations().ProductEntityUsingProdcategory;
		internal static readonly IEntityRelation ProductcategoryEntityUsingProdcategoryidStatic = new ProductcategoryRelations().ProductcategoryEntityUsingProdcategoryid;
		internal static readonly IEntityRelation ProductcategoryEntityUsingProdcateidProdcategoryidStatic = new ProductcategoryRelations().ProductcategoryEntityUsingProdcateidProdcategoryid;

		/// <summary>CTor</summary>
		static StaticProductcategoryRelations()
		{
		}
	}
}
